using Dew.Math;
using Dew.Math.Units;
namespace Dew.Examples
{
// define the real function to be minimized
private double vecfun(
TVec pars,
TVec consts,
params object[] objConsts)
{
TVec tmpVec = object0]
as TVec;
return pars[0]*tmpVec.Sum() -tmpVec.SumOfSquares()*pars[1];
}
private void Example(
TMtxOptimization opt1);
{
// ...
opt1.RealFunction = VecFun;
opt1.VariableParameters.SetIt(
false,
new double[] {-1,0)});
Vector xVec =
new Vector(0);
opt1.SetObjects(
new object[] {xVec});
}
}